package com.hezhangjian.spring.ext.example;

import com.hezhangjian.spring.ext.ProfileScheduled;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@SpringBootApplication
public class ProfileScheduledRunFixDelay {
    static class FixedDelayBean {
        @ProfileScheduled(value = "prod", fixedDelay = 5000)
        public void scheduledTask() {
            System.out.println("fixed delay task running");
        }
    }

    public static void main(String[] args) {
        SpringApplication.run(ProfileScheduledRunFixDelay.class, args);
    }
}
